package org.airline.service;

import javax.annotation.Resource;

import org.airline.dao.IOrderItemDao;
import org.airline.entity.OrderItem;
import org.airline.entity.PageBean;
import org.springframework.stereotype.Component;

@Component("OrderItemService")
public class OrderItemService implements IOrderItemDao {

	private IOrderItemDao iOrderItemDao;
	
	@Override
	public void deleteOrderItem(Long id) throws Exception {
		iOrderItemDao.deleteOrderItem(id);
	}

	@Override
	public OrderItem getorderItemById(Long id) throws Exception {
		return iOrderItemDao.getorderItemById(id);
	}

	@Override
	public PageBean queryForPage(int pageSize, int page) throws Exception {
		return iOrderItemDao.queryForPage(pageSize, page);
	}

	@Override
	public void saveOrderItem(OrderItem orderItem) throws Exception {
		iOrderItemDao.saveOrderItem(orderItem);
	}

	@Override
	public void updateOrderItem(OrderItem orderItem) throws Exception {
		iOrderItemDao.updateOrderItem(orderItem);
	}

	public IOrderItemDao getiOrderItemDao() {
		return iOrderItemDao;
	}

	@Resource(name = "OrderItemDaoImpl")
	public void setiOrderItemDao(IOrderItemDao iOrderItemDao) {
		this.iOrderItemDao = iOrderItemDao;
	}

	@Override
	public PageBean queryForPageByKeyWords(int keyWord, int pageSize,
			int page) throws Exception {
		return iOrderItemDao.queryForPageByKeyWords(keyWord, pageSize, page);
	}

	@Override
	public PageBean queryForPageByUserId(int id, int pageSize, int page)
			throws Exception {
		return iOrderItemDao.queryForPageByUserId(id, pageSize, page);
	}

}
